package com.squirrel.michale;

import java.util.Arrays;

/**
 * @author guanhao 观浩
 * @version 1.0.0.0
 * @createTime 2023/3/27 7:02 AM
 * @company Michale Squirrel
 * @link
 * @description
 */
public class LeetCode2592 {

    public int maximizeGreatness(int[] nums) {
        Arrays.sort(nums);
        int j = 0;
        for (int i = 0; i < nums.length; i++) {
            j += nums[i] > nums[j] ? 1 : 0;
        }
        return j;
    }
}
